package org.nstack.network.securitygroup;

import org.springframework.http.HttpMethod;
import org.nstack.header.identity.Action;
import org.nstack.header.message.APIMessage;
import org.nstack.header.message.APIParam;
import org.nstack.header.rest.RestRequest;

import java.util.List;

import static java.util.Arrays.asList;


@Action(category = SecurityGroupConstant.ACTION_CATEGORY)
@RestRequest(
        path = "/security-groups/{securityGroupUuid}/vm-instances/nics",
        method = HttpMethod.POST,
        responseClass = APIAddVmNicToSecurityGroupEvent.class,
        parameterName = "params"
)
public class APIAddVmNicToSecurityGroupMsg extends APIMessage {

    @APIParam(resourceType = SecurityGroupVO.class, checkAccount = true, operationTarget = true)
    private String securityGroupUuid;

    @APIParam(nonempty = true, checkAccount = true)
    private List<String> vmNicUuids;
    
    public String getSecurityGroupUuid() {
        return securityGroupUuid;
    }

    public List<String> getVmNicUuids() {
        return vmNicUuids;
    }

    public void setVmNicUuids(List<String> vmNicUuids) {
        this.vmNicUuids = vmNicUuids;
    }


    public void setSecurityGroupUuid(String securityGroupUuid) {
        this.securityGroupUuid = securityGroupUuid;
    }
 
    public static APIAddVmNicToSecurityGroupMsg __example__() {
        APIAddVmNicToSecurityGroupMsg msg = new APIAddVmNicToSecurityGroupMsg();
        msg.setSecurityGroupUuid(uuid());
        msg.setVmNicUuids(asList(uuid()));
        return msg;
    }

}
